﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
/// <summary>
/// Summary description for BUS_Product
/// </summary>
public class BUS_News : DAL_News
{
    DataTable dtP = new DataTable();
    public DataTable News_getByTop(int top)
    {
        try
        {
            dtP = DAL_News_getByTop(top);
        }
        catch
        {
        }
        return dtP;
    }
    public DataTable News_getData()
    {
        try
        {
            dtP = DAL_News_getData();
        }
        catch
        {
        }
        return dtP;
    }
    public DataTable News_getDataByTopAndType(int top, int type)
    {
        try
        {
            dtP = DAL_News_getDataByTopAndType(top,type);
        }
        catch
        {
        }
        return dtP;
    }
    public DataTable BUS_News_getDataByType(int type)
    {
        try
        {
            dtP = DAL_News_getDataByType(type);
        }
        catch
        {
        }
        return dtP;
    }
    public DataTable BUS_News_getDataById(int id)
    {
        try
        {
            dtP = DAL_News_getDataById(id);
        }
        catch
        {
        }
        return dtP;
    }
    public DataTable News_getByWhere(string where)
    {
        try
        {
            dtP = DAL_News_getByWher(where);
        }
        catch
        {
        }
        return dtP;
    }
    public DataTable News_getByCgid(int Cgid)
    {
        try
        {
            dtP = DAL_News_getByCgid(Cgid);
        }
        catch
        {
        }
        return dtP;
    }
    public DataTable News_getByTopCgid(int top, int Cgid, int pid)
    {
        try
        {
            dtP = DAL_News_getByTopCgid(top, Cgid, pid);
        }
        catch
        {
        }
        return dtP;
    }
    public DataTable News_getAllByCgid(int Cgid)
    {
        try
        {
            dtP = DAL_News_getAllByCgid(Cgid);
        }
        catch
        {
        }
        return dtP;
    }
    public DataTable News_getByMkid(int Mkid)
    {
        try
        {
            dtP = DAL_News_getByMkid(Mkid);
        }
        catch
        {
        }
        return dtP;
    }
    public DataTable News_getByPid(int Pid)
    {
        try
        {
            dtP = DAL_News_getByPid(Pid);
        }
        catch
        {
        }
        return dtP;
    }
    public DataTable News_getPriceNew(int top)
    {
        try
        {
            dtP = DAL_News_getPriceNew(top);
        }
        catch
        {
        }
        return dtP;
    }

    public DataTable News_getAllByPid(int Pid)
    {
        try
        {
            dtP = DAL_News_getAllByPid(Pid);
        }
        catch
        {
        }
        return dtP;
    }
    //public DataTable News_getMaxOrder()
    //{
    //    try
    //    {
    //        dtP = DAL_News_getMaxOrder();
    //    }
    //    catch
    //    {
    //    }
    //    return dtP;
    //}
    public DataTable News_getMaxPid()
    {
        try
        {
            dtP = DAL_News_getMaxPid();
        }
        catch
        {
        }
        return dtP;
    }
    public DTO_News LoadNews(int pid)
    {
        DTO_News dtoP = new DTO_News();
        try
        {
            dtoP = DAL_LoadNews(pid);
        }
        catch (Exception ex)
        {
            
            throw new Exception(ex.Message);
        }
        return dtoP;
    }
    public Boolean News_Update(DTO_News objP)
    {
        try
        {

            if (DAL_News_Update(objP))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        catch
        {
            return false;
        }
    }
    public Boolean News_Insert(DTO_News objP)
    {
        try
        {

            if (DAL_News_Insert(objP))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        catch
        {
            return false;
        }
    }
    public Boolean News_addtodel(int id)
    {
        try
        {
            DAL_News_addtodel(id);
        }
        catch
        {
            return false;
        }
        return true;
    }
    public Boolean News_del()
    {
        try
        {
            DAL_News_del();
        }
        catch
        {
            return false;
        }
        return true;
    }
    public DataTable News_Search(string keyword)
    {
        try
        {
            dtP = DAL_News_Search(keyword);
        }
        catch
        {
 
        }
        return dtP;
    }
}